#include "tracked.h"
#include "file_tracker.h"

#include "num/crc32.h"
#include "util/mmgr.h"					// Needs to come in early
#include "util/common_macros.h"		    // deletion, etc

using namespace res;

Tracked::~Tracked()
{
#if FILE_TRACKER_ACTIVE
	// drop self as tracked object to avoid ghosts.
	// this is expensive, but can avoid very nasty to
	// trace bugs that could otherwise appear
	FileTracker::Instance().RemoveTracked(this);
#endif
}

void				Tracked::RegisterFile(const std::string& _File)
{
#if FILE_TRACKER_ACTIVE
	FileTracker::Instance().StartTrackingFile(_File, this);
#endif
}

void				Tracked::DeRegisterFile(const std::string& _File)
{
#if FILE_TRACKER_ACTIVE
	FileTracker::Instance().EndTrackingFile(_File, this);
#endif
}
